TARGET = lynxi_mcu_bootloader

# Source dir
ST_HAL_DRIVER_SRC_DIR := Drivers/STM32G0xx_HAL_Driver/Src
ST_HAL_DIRVER_INC_DIR := Drivers/STM32G0xx_HAL_Driver/Inc

BOOT_SRC_DIR := bootloader/src
CORE_SRC_DIR := Core/Src
CORE_INC_DIR := bootloader/inc

HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_rcc.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_rcc_ex.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_ll_rcc.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_flash.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_flash_ex.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_gpio.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_dma.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_dma_ex.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_ll_dma.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_pwr.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_pwr_ex.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_cortex.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_uart.c
HAL_SOURCES += $(ST_HAL_DRIVER_SRC_DIR)/stm32g0xx_hal_uart_ex.c

C_SOURCES += $(HAL_SOURCES)
C_SOURCES += $(BOOT_SRC_DIR)/crc32.c
C_SOURCES += $(BOOT_SRC_DIR)/flash_if.c
C_SOURCES += $(BOOT_SRC_DIR)/main.c
C_SOURCES += $(BOOT_SRC_DIR)/stm32g0xx_it.c
C_SOURCES += $(BOOT_SRC_DIR)/stm32g0xx_hal_msp.c
C_SOURCES += $(BOOT_SRC_DIR)/system_stm32g0xx.c
C_SOURCES += $(BOOT_SRC_DIR)/bootloader.c
C_SOURCES += $(BOOT_SRC_DIR)/upgrade.c



# ASM sources
ASM_SOURCES =  \
startup/startup_stm32g030xx.s


SCATTER_FILE = sct/lynxi_mcu_bootloader.sct

BUILD_DIR = build_boot
